package com.ioffice.export.excel.sheet.cell;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author <a href="mailto:goodluck.sunlight@gmail.com">chenboning</a>
 *
 * 
 * @descption 描述Excel的中cell单元格对象
 *
 * @version 1.0
 *
 *
 * @time  2013-5-21  上午9:50:50
 */
public class SheetCell {

	/**
	 * x坐标
	 */
	private int x=0;
	/**
	 * y坐标
	 */
	private int y=0;
	/**
	 * 横向跨多少列
	 */
	private int xspan=1;
	/**
	 * 纵向跨多少列
	 */
	private int yspan=1;
	/**
	 * 单元格cell中的内容
	 */
	private String cellValue="";
	/**
	 * cell的id编号
	 */
	private String id="";
	/**
	 * 
	 */
	private String code="";
	/**
	 * cell中树形结构中的级别
	 */
	private int level=1;
	
	private List<SheetCell> child=null;
	
	public SheetCell() {
		if(child==null)
			child=new ArrayList<SheetCell>();
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getXspan() {
		return xspan;
	}

	public void setXspan(int xspan) {
		this.xspan = xspan;
	}

	public int getYspan() {
		return yspan;
	}

	public void setYspan(int yspan) {
		this.yspan = yspan;
	}

	public String getCellValue() {
		return cellValue;
	}

	public void setCellValue(String cellValue) {
		this.cellValue = cellValue;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}
	/**
	 * 添加子对象
	 * @param cell
	 */
	public void addSheetCell(SheetCell cell){
		this.child.add(cell);
	}
	/**
	 * 获取子对象个数
	 * @return
	 */
	public  int getChildSize(){
		return this.child.size();
	}
	/**
	 * 获取子对象列表
	 * @return
	 */
	public List<SheetCell> getChild(){
		return this.child;
	}
	
	public SheetCell getSheetCell(int index){
		return child.get(index);
	}
	
}
